package com.yanqu.road.server.cmd.group.rank;

import com.yanqu.road.pb.rank.RankProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @author ：zfr
 * @date ：2021/9/18 15:19
 */
@Cmd(code = CrossProtocol.C_GET_PATRONS_RANK_DETAIL_INFO_RETURN, desc = "从区服获取门客榜单门客详细信息")
public class GetCrossPatronsRankDetailInfoReturnCmd extends CrossCommand {
    RankProto.GetPatronsRankDetailInfoCrossRespMsg msg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        msg = RankProto.GetPatronsRankDetailInfoCrossRespMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        YanQuMessage message = YanQuMessageUtils.buildMessage(ClientProtocol.U_GET_PATRONS_RANK_DETAIL_INFO, msg.getRespMsg());
        MessageHelper.sendPacket(msg.getFromServerId(), msg.getFromUserId(), message);
    }

    @Override
    public void sendData() {

    }
}
